<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>报告列表</title>
<!--                       CSS                       -->
<!-- Reset Stylesheet -->
<link rel="stylesheet" href="<%=path%>/resources/css/reset.css"
	type="text/css" media="screen" />
<!-- Main Stylesheet -->
<link rel="stylesheet" href="<%=path%>/resources/css/qr.css"
	type="text/css" media="screen" />
<link rel="stylesheet" href="<%=path%>/resources/css/invalid.css"
	type="text/css" media="screen" />
<link type="text/css"
	href="<%=path%>/resources/date/jquery.datepick.css" rel="stylesheet" />
</head>
<body>
	<form action="queryReport.action" id="ilist"  method="post">
		
		<div id="body-wrapper">
		<div style="text-align:right">
			<input class="button" type="submit"
							value="查   询" style="width:80px" style="margin-top:0px;"
							id="btnlogin" />&nbsp;&nbsp;&nbsp;
			<input class="button" type="button"
							value="导出采集表 " style="width:80px" style="margin-top:0px;"
							id="btnlogin" onclick="javascript:collect()"/>&nbsp;&nbsp;&nbsp;
			<input class="button" type="submit"
							value="导出统计表 " style="width:80px" style="margin-top:0px;"
							id="btnlogin"  onclick="javascript:statistic()"/>&nbsp;&nbsp;&nbsp;
			<input class="button" type="button"
							value=" 封   面  " style="width:80px" style="margin-top:0px;"
							id="btnlogin"   onclick="javascript:frontcover()"/>&nbsp;&nbsp;&nbsp;
			<input class="button" type="button"
							value=" 分工表  " style="width:80px" style="margin-top:0px;"
							id="btnlogin"   onclick="javascript:division()"/>&nbsp;&nbsp;&nbsp;				
						<!-- <a href="#">高级搜索&gt;&gt;</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -->	
		</div>
				
			<!-- End #sidebar -->
			<div id="main-content">


				<!-- End .clear -->
				<div class="content-box">
					<div id="basic">&nbsp;报告年度:<s:textfield cssClass="text-input" id="reportYear" name="report.reportyear"  cssStyle="width:80px"></s:textfield>
								报告类型:<s:select name="report.reporttype" cssStyle="width:94px;height:32px" list="#request.rptpemap"	listKey="key" listValue="value" value="report.reporttype"	headerKey="0" headerValue="请选择"></s:select>
								联系电话:<s:textfield  cssClass="text-input" 	id="report_telephone" name="report.telephone"   cssStyle="width:80px"/>
								报告单号:<s:textfield	cssClass="text-input" id="report_reportno"	name="report.reportno"   cssStyle="width:80px"/>
								项目负责人:<s:select name="report.projectleader" cssStyle="width:80px;height:30px" 
												list="#request.project_leaderList"   listKey="uid" listValue="name" value="report.projectleader"  headerKey="-1" headerValue="请选择"></s:select>
								
							
						<!-- End .content-box-header -->
					</div>
					<br/>
					<div id="more">
						&nbsp;
						
						接受日期:<s:textfield cssClass="text-input" id="receiveTime"		name="report.receivedate"  cssStyle="width:80px"/>
						                  发放日期:<s:textfield  cssClass="text-input"  id="issueTime" 	name="report.senddate"  cssStyle="width:80px"/>
							     完成日期:<s:textfield  cssClass="text-input"  id="finishTime" 	name="report.finishdate"  cssStyle="width:80px"/>
							     收款日期:<s:textfield  cssClass="text-input"  id="receiptTime"	name="report.receiptdate"  cssStyle="width:80px"/>
							     企业名称:<s:textfield cssClass="text-input" id="enterprise_companyname"	name="enterprise.companyname"    cssStyle="width:170px"/>
						<!-- End .content-box-header -->
					</div>
					<div class="content-box-content">
						<div class="tab-content default-tab" id="tab1">

							<table>
								<thead>
									<tr>
										<th><input class="check-all" type="checkbox" id="chk_all" title="全选/全不选" /></th>
										<th>报告年度</th>
										<th>报告单号</th>
										<th>报告类型</th>
										<th>项目负责人</th>
										<th>企业名称</th>
										<th>协议金额(元)</th>
										<!--  
										<th>接受日期</th>
										<th>发放日期</th>-->
										<th>完成日期</th>
										<th>操作</th>
									</tr>
								</thead>
								
								<tbody>
								
								<s:iterator value="#request.reportList" id="rpt1" status="rpt">
									<tr>
										<td><input type="checkbox" name="rptid" value='<s:property value="#request.reportList[#rpt.index].rid"/>'/></td>
										<td><s:property value="#request.reportList[#rpt.index].reportyear"/></td>
										<td><a href="javascript:view(<s:property value="#request.reportList[#rpt.index].rid"/>)" title="title"><s:property value="#request.reportList[#rpt.index].reportno"/></a></td>
										<td><s:property value="#request.reportList[#rpt.index].reporttypename"/></td>
										<td><s:property value="@com.xyz.init.infos.UserInfosInit@getName(#request.reportList[#rpt.index].projectleader)"/></td>
										<td><s:property value="#request.reportList[#rpt.index].companyname"/></td>
										<td><s:property value="#request.reportList[#rpt.index].treatyprice"/></td>
										<!--  
										<td><s:property value="#request.reportList[#rpt.index].receivedate"/></td>
										<td><s:property value="#request.reportList[#rpt.index].senddate"/></td>-->
										<td><s:property value="#request.reportList[#rpt.index].finishdate"/></td>
										<td align="center">
										
											<a href="#" title="修改">
												<img src="<%=path%>/resources/images/icons/pencil.png" alt="修改" onclick='javascript:edit(<s:property value="#request.reportList[#rpt.index].rid"/>)'/>
											</a> 
											<a href="#" title="删除">
												<img src="<%=path%>/resources/images/icons/cross.png" alt="删除" onclick='javascript:del(<s:property value="#request.reportList[#rpt.index].rid"/>)'/> 
											</a>
											<!--  
											<a href="#" title="Edit Meta">
												<img src="<%=path%>/resources/images/icons/hammer_screwdriver.png"	alt="Edit Meta" /> 
											</a>-->
										</td>
									</tr>
								
								</s:iterator>
								</tbody>
								<tfoot>
									<tr>
										<td colspan="6">
										<!--
											<div class="pagination">
												<a href="javascript:page(1)" title="First Page">&laquo; 首页</a>
												<a href="javascript:page(-1)"	 title="Previous Page">&laquo; 前一页</a> 
												<a href="javascript:page(1)"	 class="number" title="1">1</a> 
												<a href="javascript:page(1)"     class="number" title="2">2</a>
												<a href="javascript:page(1)"     class="number current"	title="3">3</a> 
												<a href="#" class="number" title="4">4</a>
												<a href="javascript:page(+1)" title="Next Page">后一页 &raquo;</a>
												<a href='javascript:page(last)'	title="Last Page">末页 &raquo;</a>
											</div> 
											  -->
											<s:property value="pageContent" escape="false"/>
											<input type="hidden" id="pageNow" name="pageNow" value='<s:property value="pageNow"/>'/>
											<input type="hidden" id="rptId" name="rptId"/>
											<input type="hidden" id="iflag" name="flag"/>
											<div class="clear"></div></td>
									</tr>
								</tfoot>
							</table>
						</div>

					</div>
					<!-- End .content-box-content -->
				</div>

				<!-- End #footer -->
			</div>
			<!-- End #main-content -->
		</div>
	</form>
</body>
<!-- Download From www.exet.tk-->
</html>
<script type="text/javascript"
	src="<%=path%>/resources/scripts/jquery-1.8.3.min.js"></script>
<script type="text/javascript"
	src="<%=path%>/resources/date/jquery.datepick.js"></script>
<script type="text/javascript"
	src="<%=path%>/resources/date/jquery.datepick-zh-CN.js"></script>
<script type="text/javascript">
<!--
$(document).ready(function(){
	$('#receiveTime').datepick({dateFormat: 'yy-mm-dd'}); 
	$('#issueTime').datepick({dateFormat: 'yy-mm-dd'}); 
	$('#finishTime').datepick({dateFormat: 'yy-mm-dd'}); 
	$('#openTime').datepick({dateFormat: 'yy-mm-dd'}); 
	$('#receiptTime').datepick({dateFormat: 'yy-mm-dd'});
	$('#beginTime').datepick({dateFormat: 'yy-mm-dd'}); 
	$('#endTime').datepick({dateFormat: 'yy-mm-dd'}); 
	$("#chk_all").click(function(){
	     //$("input[name='rptid']").attr("checked",$(this).attr("checked"));
		$("input[name='rptid']").prop("checked", this.checked);
	});
});

function page(num,type){
	var now = <s:property value="pageNow"/>;
	if(type==-1){
		$("#pageNow").val(now-1);
	}else if(type==1){
		$("#pageNow").val(now+1);
	}else{
		$("#pageNow").val(num);
	}

	$("#ilist").submit();
};



function del(rptid){
	$("#rptId").val(rptid);
	var answer = confirm("是否删除这条记录?");
	if(answer){
		$("#ilist").attr("action", "deleteReport.action").submit();   
	}
	else{
		return;
	}
};
function view(rptid){
	$("#rptId").val(rptid);
	$("#iflag").val(3);
	$("#ilist").attr("action", "editReport.action?rptid.rid="+rptid);
	$("#ilist").submit();
};
function edit(rptid){
	$("#rptId").val(rptid);
	$("#iflag").val(2);
	$("#ilist").attr("action", "editReport.action?rptid.rid="+rptid);
	$("#ilist").submit();	
};

//采集
function collect(){
	var chk_value =[];    
	  $('input[name="rptid"]:checked').each(function(){    
	   chk_value.push($(this).val());    
	  });    
	  if(chk_value.length==0){
		  alert('你还没有选择任何内容！');
	  }
	  else if(chk_value.length>1){
		  alert('只能选择一条记录！');
	  }
	  else{
		  $("#rptId").val(chk_value[0]);
		  $("#ilist").attr("action", "exportCollect.action").submit(); 
	  }
	  
};
//统计
function statistic(){
	$("#ilist").attr("action", "exportStatistic.action").submit(); 
};

//封面
function frontcover(){
	var chk_value =[];    
	  $('input[name="rptid"]:checked').each(function(){    
	   chk_value.push($(this).val());    
	  });    
	  if(chk_value.length==0){
		  alert('你还没有选择任何内容！');
	  }
	  else if(chk_value.length>1){
		  alert('只能选择一条记录！');
	  }
	  else{
		  $("#rptId").val(chk_value[0]);
		  $("#ilist").attr("action", "frontcover.action").submit(); 
	  }
}
//分工表
function division(){
	var chk_value =[];    
	  $('input[name="rptid"]:checked').each(function(){    
	   chk_value.push($(this).val());    
	  });    
	  if(chk_value.length==0){
		  alert('你还没有选择任何内容！');
	  }
	  else if(chk_value.length>1){
		  alert('只能选择一条记录！');
	  }
	  else{
		  $("#rptId").val(chk_value[0]);
		  $("#ilist").attr("action", "division.action").submit(); 
	  }
	
}
//-->
</script>

